package com.incar.chuxing.utils.ble.utils;

import java.util.Calendar;
import java.util.TimeZone;

public class DateTimeHelper {

    public static boolean isToday(Calendar dt) {
        return isSameDay(Calendar.getInstance(), dt);
    }

    public static boolean isSameDay(Calendar dt, Calendar dt1) {
        return dt1.get(Calendar.YEAR) == dt1.get(Calendar.YEAR)
                && dt1.get(Calendar.MONTH) == dt1.get(Calendar.MONTH) && dt1.get(Calendar.DAY_OF_MONTH) == dt1.get(Calendar.DAY_OF_MONTH);
    }

    public static long getTimeOfUTC(int year, int month, int day, int hour, int minute, int second) {
        Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
        cal.set(year, month - 1, day, hour, minute, second);
        return cal.getTimeInMillis();

    }
}
